<?php

namespace App\Services;

use Illuminate\Support\Facades\Validator;

class ValidatorService extends ServiceBase
{
    // 校验表单数据属性
    public function validate($params, $rules)
    {
        $validator = Validator::make($params, $rules);
        if ($validator->stopOnFirstFailure()->fails()) {
            return false;
        }

        return true;
    }
}
